package com.design.builder;

/**
 * @Author: ChengLei.Liu
 * @Date: 2020-06-10 09:52
 * @Description:
 */
public class Director {

    private AbstractCarBuilder abstractCarBuilder;

    public Director(AbstractCarBuilder abstractCarBuilder){
        this.abstractCarBuilder = abstractCarBuilder;
    }

    public void setAbstractCarBuilder(AbstractCarBuilder abstractCarBuilder) {
        this.abstractCarBuilder = abstractCarBuilder;
    }

    public Car buildCar(){
        abstractCarBuilder.buildCarName();
        abstractCarBuilder.buildWheel();
        abstractCarBuilder.buildBody();
        abstractCarBuilder.buildColor();
        abstractCarBuilder.buildLight();
        return abstractCarBuilder.createCar();
    }
}
